<div class="modal" ng-controller="VertexModalSelectController">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" ng-click="$hide()" aria-hidden="true">×
        </button>
        <h3>Select Vertex </h3>
      </div>


      <div class="modal-body modal-query">

        <div class="container-fluid">
          <div class="row">
            <div class="col-md-6">
              <p><strong>Ctrl + Enter</strong> to execute the query</p>
            </div>
            <div class="col-md-6">
              <form class="form-inline nomargin">
                <button ng-click="query()" class="btn btn-xs pull-right">
                  <i class="fa fa-cog"></i> Run
                </button>
              </form>
            </div>
          </div>
          <div class="row ">
            <form ng:submit="query()" class="form-inline">
              <div ui-codemirror="editorOptions" ng-model="queryText"></div>
            </form>
          </div>

          <div class="row query-result">
            <div class="table-responsive">

              <table st-table="displayedRecords" st-safe-src="results"
                     class="table table-striped table-bordered table-hover table-condensed pointer"
                     ng-show="headers">
                <thead>
                <tr>
                  <th>#</th>
                  <th ng-repeat="header in headers">{{header}}</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="result in displayedRecords">
                  <td><input type="checkbox" ng-checked="added.indexOf(result['@rid'])!=-1" ng-click="select(result)"/>
                  </td>
                  <td ng-repeat="header in headers">{{result[header]}}</td>
                </tr>
                </tbody>
                <tfoot>
                <tr>
                  <td colspan="{{headers.length}}" class="text-center">
                    <div st-pagination="" st-items-by-page="5" st-displayed-pages="7"></div>
                  </td>
                </tr>
              </table>
            </div>
            <div class="row">
              <div class="alert alert-danger" ng-show="error">
                {{error}}
              </div>
            </div>
          </div>
        </div>

        <div class="modal-footer">
          <button type="button" class="btn btn-default" ng-click="$hide()">Close</button>
          <button class="btn btn-primary" ng-disabled="added.length==0"
                  ng-click="modal.saved=true;$hide();okSelect()">Ok
          </button>
        </div>
      </div>
    </div>
  </div>
